package com.luomo.java.se;

/**
 * @author LiuMei
 * @date 2021-04-19.
 */
public class StringPoolDemo {

    public static void main(String[] args) {
        //只有java是false 其他是true
        String str1 = new StringBuilder("58").append("tongcheng").toString();
        System.out.println(str1);
        System.out.println(str1.intern());
        System.out.println(str1==str1.intern());
        System.out.println();
        String str2 = new StringBuilder("ja").append("va").toString();
        System.out.println(str2);
        System.out.println(str2.intern());
        System.out.println(str2==str2.intern());
    }

}
